using System.Text;

namespace iDomainChecker
{
    internal class WhoisServer
    {
        private string m_DisplayName;

        private string m_URI;

        private string m_Content;

        private Encoding m_ResponseEncoding;

        private string m_ValidString;

        private string m_InvalidString;

        private string m_TimeoutString;

        private int m_TimeOut = 30;

        private string m_Referer;

        private RequestMethod m_Method;


        public enum RequestMethod
        {
            Get,
            Post
        }

        /// <summary>
        /// Gets or sets the name of the display.
        /// </summary>
        /// <value>The name of the display.</value>
        public string DisplayName
        {
            get { return m_DisplayName; }

            set { m_DisplayName = value; }
        }


        /// <summary>
        /// Gets or sets the URI.
        /// </summary>
        /// <value>The URI.</value>
        public string URI
        {
            get { return m_URI; }

            set { m_URI = value; }
        }

        /// <summary>
        /// Gets or sets the content.
        /// </summary>
        /// <value>The content.</value>
        public string Content
        {
            get { return m_Content; }

            set { m_Content = value; }
        }


        /// <summary>
        /// Gets or sets the valid string.
        /// </summary>
        /// <value>The valid string.</value>
        public string ValidString
        {
            get { return m_ValidString; }

            set { m_ValidString = value; }
        }


        /// <summary>
        /// Gets or sets the invalid string.
        /// </summary>
        /// <value>The invalid string.</value>
        public string InvalidString
        {
            get { return m_InvalidString; }

            set { m_InvalidString = value; }
        }

        /// <summary>
        /// Gets or sets the timeout string.
        /// </summary>
        /// <value>The timeout string.</value>
        public string TimeoutString
        {
            get { return m_TimeoutString; }

            set { m_TimeoutString = value; }
        }


        /// <summary>
        /// Gets or sets the time out.
        /// </summary>
        /// <value>The time out.</value>
        public int TimeOut
        {
            get { return m_TimeOut; }

            set
            {
                if (value < 1)
                {
                    m_TimeOut = 30;
                }
                else
                {
                    m_TimeOut = value;
                }
            }
        }

        /// <summary>
        /// Gets or sets the referer.
        /// </summary>
        /// <value>The referer.</value>
        public string Referer
        {
            get { return m_Referer; }

            set { m_Referer = value; }
        }

        /// <summary>
        /// Gets or sets the method.
        /// </summary>
        /// <value>The method.</value>
        public RequestMethod Method
        {
            get { return m_Method; }

            set { m_Method = value; }
        }

        /// <summary>
        /// Gets or sets the response encoding.
        /// </summary>
        /// <value>The response encoding.</value>
        public Encoding ResponseEncoding
        {
            get { return m_ResponseEncoding; }

            set { m_ResponseEncoding = value; }
        }

        /// <summary>
        /// Returns a <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>.
        /// </summary>
        /// <returns>
        /// A <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>.
        /// </returns>
        public override string ToString()
        {
            return DisplayName;
        }
    }
}